import request from '@/utils/request'

export default {

  // 添加课程分类信息
  addCourseInfo(courseInfo) {
    return request({
      url: `/edu_service/course/addCourse`,
      method: 'post',
      data: courseInfo
    })
  },
  // 查询所有讲师
  getListTeacher() {
    return request({
      url: `/edu_service/teacher/findAll`,
      method: 'get'
    })
  },
  //根据课程id查询课程基本信息
  getCourseInfoId(id) {
    return request({
      url: `/edu_service/course/getCourseInfo/${id}`,
      method: 'get'
    })
  },
  // 修改课程信息
  updateCourseInfo(courseInfo) {
    return request({
      url: '/edu_service/course/updateCourseInfo',
      method: 'post',
      data: courseInfo
    })
  },
  // 课程信息确认
  getPublishCourseInfo(id) {
    return request({
      url: `/edu_service/course/getPublishCourseInfo/${id}`,
      method: 'get',
    })
  },
  // 提交课程信息
  publishCourse(id) {
    return request({
      url: `/edu_service/course/publishCourse/${id}`,
      method: 'post',
    })
  },
  // 课程分页
  pageListCourse(current, limit, course) {
    return request({
      url: `/edu_service/course/pageCourseCondition/${current}/${limit}`,
      method: 'post',
      data: course
    })
  },
  // 删除课程
  deleteCourse(id) {
    return request({
      url: `/edu_service/course/deleteCourse/${id}`,
      method: 'delete'
    })
  },
  // 修改课程状态
  updateStatus(course){
    return request({
      url: `/edu_service/course/updateCourseStatus`,
      method: 'post',
      data: course
    })
  }


}

